#include<stdio.h>

void swap_wrong(int a,int b){ //pass by value
    printf("inside func swap:&a=%x &b=%x\n",&a,&b);
    int t;t=a;a=b;b=t;
}
void swap(int*a,int *b){
    printf("inside func swap:a=%x b=%x\n",a,b);
    int t;
    t=*a;*a=*b;*b=t;
}
int main(){
    int a=3,b=4;
    printf("inside func main:&a=%x &b=%x\n",&a,&b);
    //swap_wrong(a,b);
    swap(&a,&b);
    printf("a=%d b=%d\n",a,b);
    return 0;
}
